package cn.edu.scau.service.impl;

import java.util.Date;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import cn.edu.scau.dao.DishCalenderMapper;
import cn.edu.scau.entity.DishCalender;
import cn.edu.scau.entity.DishCalenderShow;
import cn.edu.scau.service.DishCalenderService;

@Service
public class DishCalenderServiceImpl implements DishCalenderService {
	@Autowired
	private DishCalenderMapper dishCalenderMapper;
	
	@Override
	public boolean insert(DishCalender dishCalender) {
		//业务逻辑判断
		int line = dishCalenderMapper.insertSelective(dishCalender);
		return line == 1 ? true:false;
	}

	@Override
	public boolean update(DishCalender dishCalender) {
		//业务逻辑判断
		int line = dishCalenderMapper.updateByPrimaryKeySelective(dishCalender);
		return line == 1 ? true:false;
	}

	@Override
	public boolean delete(Integer id) {
		//业务逻辑判断
		int line = dishCalenderMapper.deleteByPrimaryKey(id);
		return line == 1 ? true:false;
	}

	@Override
	public DishCalender selectById(Integer id) {
		//业务逻辑判断
		return dishCalenderMapper.selectByPrimaryKey(id);
	}

	@Override
	public List<DishCalenderShow> selectAll() {
		//业务逻辑判断
		return dishCalenderMapper.selectAll();
	}

	@Override
	public List<DishCalenderShow> findByDishcalenderdateDishcalendertime(Date dishcalenderdate,
			String dishcalendertime) {
		//业务逻辑判断
		return dishCalenderMapper.findByDishcalenderdateDishcalendertime(dishcalenderdate, dishcalendertime);
	}

}
